<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./JS/vue.js"></script>
</head>
<body>
    <div id="app">
        <cpn :cmovies="movies" :cmessage="message"></cpn>
    </div>
    <template id="cpn">
        <div>
            <h2>{{cmessage}}</h2>
            <ul>
                <li v-for="item in cmovies" :key="item">{{item}}</li>
            </ul>
        </div>
    </template>
    <script>
        const app = new Vue({
            el: '#app',
            data:{
                message: '电影',
                movies:['存储','重启','让出']
            },
            components: {
                'cpn':{
                    template: '#cpn',
                    // props: ['cmovies','cmessage'],
                    props: {
                        cmovies:Array,
                        //可以提供默认值
                        cmessage:{
                            type: String,
                            default: 'aaaaaa',
                            required: false
                        }
                    },
                    data () {
                        return {
                            
                        }
                    }
                }
            }
        })
    </script>
</body>
</html>